.container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

.card-body {
    background-color: #5e5e5e;
}

.card-subtitle {
    color: rgba(255, 255, 255, 0.596);
    padding-top: 5px;
}

.mt-4 {
    border: 0px solid rgba(0, 0, 0, .125);
}

/* ============================================================
   Article cards (blog listing)
   ============================================================ */

.article-grid-container {
    width: 100%;
    max-width: 1900px;
    margin: 0 auto;
    padding: 0 20px 20px;
    box-sizing: border-box;
}

.article-grid {
    display: grid;
    /* 7 across on wide screens, narrowing down as the viewport shrinks */
    grid-template-columns: repeat(7, 1fr);
    gap: 14px;
}

@media (max-width: 1600px) {
    .article-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1100px) {
    .article-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 460px) {
    .article-grid {
        grid-template-columns: 1fr;
    }
}

.article-card {
    background-color: #2b2f36;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.article-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
    transform: translateY(-2px);
}

.article-ribbon {
    position: absolute;
    top: 16px;
    left: -36px;
    width: 140px;
    transform: rotate(-45deg);
    background-color: rgba(15, 15, 18, 0.85);
    text-align: center;
    padding: 4px 0;
    z-index: 2;
    pointer-events: none;
}

.article-ribbon-label {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Added by disable-new-label.js once an article is more than 7 days old. */
.article-ribbon.expired-label {
    display: none;
}

/* Ribbon banner on the ad card in the blog grid (see AdSlot.ejs's
   'article' variant) - same diagonal-ribbon treatment and geometry as a
   new article's "NEW" ribbon above, in its own color so an ad is never
   mistaken for a new post. Unlike .article-ribbon, this one is never
   hidden by disable-new-label.js - an ad stays labeled for as long as
   it's live. */
.ad-ribbon {
    position: absolute;
    top: 16px;
    left: -36px;
    width: 140px;
    transform: rotate(-45deg);
    background-color: #f5a623;
    text-align: center;
    padding: 4px 0;
    z-index: 2;
    pointer-events: none;
}

.ad-ribbon-label {
    color: #1c1f24;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.article-image-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #1c1f23;
    position: relative;
}

/* Skeleton shimmer, shown behind the <img> until image-skeleton.js marks it
   loaded (see public/scripts/image-skeleton.js). Sits on the wrapper so it's
   visible even before the <img> itself has painted anything. */
.article-image-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #1c1f23 0%, #262b31 50%, #1c1f23 100%);
    background-size: 200% 100%;
    animation: article-skeleton-shimmer 1.4s ease-in-out infinite;
}

.article-image-wrapper.is-loaded::before {
    animation: none;
    display: none;
}

@keyframes article-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.article-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.article-image.is-loaded {
    opacity: 1;
}

.article-body {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    color: #fff;
    font-weight: 700;
    text-align: center;
    font-size: 14px;
    line-height: 1.25;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    text-align: center;
    margin-bottom: 8px;
}

.article-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    line-height: 1.35;
    flex: 1;
    margin-bottom: 0;
}

.article-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}

.read-more-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #1877f2;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 0;
    text-decoration: none;
    border: none;
}

.read-more-btn:hover {
    background-color: #145fc4;
    color: #fff;
    text-decoration: none;
}
